In the prior art, as an image forming apparatus for forming an image on a recording medium such as paper, there is known a position detection of the recording medium with a reflection type optical sensor. In the image forming apparatus an image is formed by alternately performing an action of moving the recording medium in an auxiliary scanning direction and an action of moving a carriage carrying a recording head in a main scanning direction. For example, a configuration is known in which the reflection type optical sensor is carried on the carriage. Here, the reflection type optical sensor is provided with a light emitting element for emitting a light and a light receiving element for detecting the reflected light of the light emitted by the light emitting element, so that the presence/absence of the recording medium in the irradiation target portion of the like is detected on the basis of the quantity of the reflected light detected by the light receiving element. Specifically, the light emitted by the light emitting element is reflected on the recording medium if this recording medium is present in the irradiation target portion. If the recording medium is not present in the irradiation target portion, the light is reflected on a platen for supporting the recording medium in a manner so as to confront the recording head. When the reflection on the recording medium and the reflection on the platen are different, it is possible to detect the presence/absence of the recording medium on the basis of the quantity of the reflected light. The recording medium usually has a white color, and it is decided that if the quantity of the reflected light is at a threshold value or larger, the recording medium is present and the platen of the black color is used. If the quantity of the reflected light is less than the threshold value, it is decided that the recording medium is not present. According to the image forming apparatus thus configured, the position of the side end portion of the recording medium can be detected by detecting the presence/absence of the recording medium while moving the position of the reflection type optical sensor in the main scanning direction. As a result, it is possible to adjust the position of the image precisely to the recording medium.
Even with the black platen, however, the quantity of the reflected light is not zero. Then, it is considered that the detection precision may be lowered by the influences of the reflected light in the state where the recording medium is not present in the irradiation target portion of the light.
Thus, a configuration, in which a sloped face is formed on the platen at the irradiation target portion of the light from a light emitting element, has been proposed in JP-A-2004-255867. With this configuration, the light from the light emitting element can be positively reflected by the sloped face in the direction having no light receiving element.